package collection;

import java.util.ArrayList;
import java.util.List;

public class ListDemo2 {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>();
        //List<String> list=new LinkedList<>();
        list.add("ONE");
        list.add("TWO");
        list.add("THREE");
        list.add("FOUR");
        list.add("fIVE");
        System.out.println(list);
        list.add(3,"SIX");
        System.out.println(list);
        String old=list.remove(2);
        System.out.println(old);
        System.out.println(list);

    }
}
